package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.IcVolunteersMapper;
import com.ruoyi.system.domain.IcVolunteers;
import com.ruoyi.system.service.IIcVolunteersService;
import com.ruoyi.common.core.text.Convert;

/**
 * 志愿者Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-10
 */
@Service
public class IcVolunteersServiceImpl implements IIcVolunteersService 
{
    @Autowired
    private IcVolunteersMapper icVolunteersMapper;

    /**
     * 查询志愿者
     * 
     * @param volunteerId 志愿者主键
     * @return 志愿者
     */
    @Override
    public IcVolunteers selectIcVolunteersByVolunteerId(Long volunteerId)
    {
        return icVolunteersMapper.selectIcVolunteersByVolunteerId(volunteerId);
    }

    /**
     * 查询志愿者列表
     * 
     * @param icVolunteers 志愿者
     * @return 志愿者
     */
    @Override
    public List<IcVolunteers> selectIcVolunteersList(IcVolunteers icVolunteers)
    {
        return icVolunteersMapper.selectIcVolunteersList(icVolunteers);
    }

    /**
     * 新增志愿者
     * 
     * @param icVolunteers 志愿者
     * @return 结果
     */
    @Override
    public int insertIcVolunteers(IcVolunteers icVolunteers)
    {
        icVolunteers.setCreateTime(DateUtils.getNowDate());
        return icVolunteersMapper.insertIcVolunteers(icVolunteers);
    }

    /**
     * 修改志愿者
     * 
     * @param icVolunteers 志愿者
     * @return 结果
     */
    @Override
    public int updateIcVolunteers(IcVolunteers icVolunteers)
    {
        icVolunteers.setUpdateTime(DateUtils.getNowDate());
        return icVolunteersMapper.updateIcVolunteers(icVolunteers);
    }

    /**
     * 批量删除志愿者
     * 
     * @param volunteerIds 需要删除的志愿者主键
     * @return 结果
     */
    @Override
    public int deleteIcVolunteersByVolunteerIds(String volunteerIds)
    {
        return icVolunteersMapper.deleteIcVolunteersByVolunteerIds(Convert.toStrArray(volunteerIds));
    }

    /**
     * 删除志愿者信息
     * 
     * @param volunteerId 志愿者主键
     * @return 结果
     */
    @Override
    public int deleteIcVolunteersByVolunteerId(Long volunteerId)
    {
        return icVolunteersMapper.deleteIcVolunteersByVolunteerId(volunteerId);
    }
}
